﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RMS.DataAccess.Repositories;
using RMS.DataAccess.Entities;
using RMS.Utils.Controls;
using RMS.Utils.MVP;
using RMS.Web.Shell.Presenter;
using RMS.Utils.Navigator;
using Microsoft.Reporting.WebForms;

//
using RMS.Utils.Histogram;

namespace RMS
{
    public partial class Default : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Notification1.Show();

        }



        private void bindGV(int startIndex, int lenght)
        {
            //var result = this.Presenter.GetPatients(startIndex, lenght);
            //gvBookedRedology.DataSource = result.Rows;
            //Pager.TotalRecords = result.RowCount;
            //gvBookedRedology.DataBind();

        }
        public void ButtonAction(string command, int moduleId)
        {
            if (command == "Edit")
            {
                Navigator.NavigateTo(Pages._ErrorView, new string[] { moduleId.ToString() });

            }
            else if (command == "Remove")
            {
                //    this.Presenter.RemovePationt(moduleId);
            }
        }
        protected void Pager_PageIndexChange(object sender, EventArgs e)
        {
            RMS.Utils.Controls.DataPager m = (RMS.Utils.Controls.DataPager)sender;
            bindGV(m.CurrentStartRow, m.RecordsPerPage);
        }

        protected void gvBookedRedology_RowCommand1(object sender, GridViewCommandEventArgs e)
        {
            string m = e.CommandName.ToString();
            GridView gv = (GridView)sender;
            int moduleId = Convert.ToInt32(gv.DataKeys[Convert.ToInt32(e.CommandArgument)].Value);
            ButtonAction(e.CommandName, moduleId);
        }

        protected void Unnamed1_Click(object sender, EventArgs e)
        {
            // Pager.TotalRecords = 10;

        }

        protected void Timer1_Tick(object sender, EventArgs e)
        {

        }

        protected void UpdatePanel1_Load(object sender, EventArgs e)
        {
            //TextBox2.Text = DateTime.Now.ToLongTimeString();

        }
    }
}